var db = require('../../config/db')
var bcrypt = require('bcryptjs')

//获取用户个人信息
exports.getAdminInfo = (req, res) =>{
    var sql = 'select id, name, phone, address, sex, age, avatar from admin_info where id=?'
    db.query(sql, req.auth.id, (err, results)=>{
        if(err) return res.cc('400',err)
        if(results.length !== 1) return res.cc('400','获取用户信息失败')
        res.send({ //返回前端信息
            status: 200,
            message: '获取管理员信息成功',
            data: results[0]
        })
    })
}